package com.rd.student.jiaji.class3.wangyanbo.day0731;

import java.util.ArrayList;

public class Test4 {
    public static void main(String[] args) {
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < 20; i++) {
            int random=(int)(Math.random()*50);
            if (arrayList.contains(random)){
                i--;
                continue;
            }
            arrayList.add(random);
        }
        System.out.println(arrayList);
    }
}
